<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <main id="app">
        <div :style="[baseStyle,colorStyle]"></div>
    </main>
</body>
<script src="../../vue.js"></script>
<script>
    let vue = new Vue({
        el: "#app",
        data: {
            baseStyle: {
                width: "100px",
                height: "100px",
                borderRadius: "50%",
            },
            colorStyle: {
                backgroundColor: "red"
            },
        },
    })

    let times = [1500,500,1500];
    let colors = ["red","yellow","green"];
    let index = 1;
    setInterval(() => {
        vue.colorStyle.backgroundColor = colors[index];
        index ++;
        if (index >= times.length) {
            index = 0;
        }
    },times[index])
</script>
</html>